import { _decorator, AssetManager, assetManager, Component, director, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('BootStrap')
export class BootStrap extends Component {
    start() {
        //加载资源
        assetManager.loadBundle("resources", (err: any, data1: AssetManager.Bundle) => {
            if (!err) {
                assetManager.loadBundle("scripts", (err: any, data: AssetManager.Bundle) => {
                    if (!err) {
                        data1.loadScene("Loading", function (err, scene) {
                            director.runScene(scene);
                        });
                    } else {
                        console.error(err);
                    }
                });
            } else {
                console.error(err);
            }
        })
    }

}


